package com.bugs.pojo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

public enum SpiderOption {
    JOB51_SPIDER    ("前程无忧", "51jobSpider"),
    LIEPIN_SPIDER   ("猎聘", "liePinSpider"),
    BOSS_SPIDER     ("BOSS直聘", "bossSpider");

    private String name;
    private String type;
    private static List<Option> options = new ArrayList<>();
    static  {
        options.add(JOB51_SPIDER.getOption());
        options.add(LIEPIN_SPIDER.getOption());
        options.add(BOSS_SPIDER.getOption());
    }

    SpiderOption(String name, String type) {
        this.name = name;
        this.type = type;
    }


    @Data
    @Accessors(chain = true)
    class Option{
        private String name;
        private String type;
    }

    public Option getOption() {
        return new Option().setName(this.name).setType(this.type);
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public static List<Option> getOptions() {
        return options;
    }
}
